package com.ithuaxin.array;

import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        int arr1[] = {12,14,23,45,66,68,70,77,90,91};
        int arr2[] = new int[arr1.length + 1];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = sc.nextInt();
        int index = 0;
        for (int i = 0; i < arr1.length; i++) {
            if (num >= arr1[i]){
                arr2[i] = arr1[i];
                index = i + 1;
            }else{
                arr2[i+1] = arr1[i];
            }
        }
        arr2[index] = num;
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
    }
}
